{% set clazz = "records" %}
{% set title = "积分明细" %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" type="text/css" href="{{ '/static/css/integral.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
  <header class="bar bar-header">
    {{ macro.back() }}
    <h1 class="title">{{ title }}</h1>
  </header>
  {% endif %}
  <section>
    <div class="filter">
      <div class="tabs compact" data-tabs="true">
        <a href="#details" class="item active">明细</a>
        <a href="#inputs" class="item">收入</a>
        <a href="#outputs" class="item">支出</a>
      </div>
    </div>
    <div id="details" class="tabpane active">
      {% include "./modules/integral/templates/partial/tabpartal.html" with {list: details.list, blank: '您还没有明细哦'} only %}
    </div>
    <div id="inputs" class="tabpane">
      {% include "./modules/integral/templates/partial/tabpartal.html" with {list: inputs.list, blank: '您还没有收入记录哦'} only %}
    </div>
    <div id="outputs" class="tabpane">
      {% include "./modules/integral/templates/partial/tabpartal.html" with {list: outputs.list, blank: '您还没有支出记录哦'} only %}
    </div>
  </section>
  {% raw %}
    <script id="records" type="text/swig-template">
      {% for item in list %}
        <div class="list hspace">
          <div class="item text-sm" ui-mode="20px">
            <span class="text">
              {{item.productName}}
              <p>{{ item.optTime|number|date('Y-m-d') }}</p>
            </span>
            <span class="text text-right">
              {% if item.optType != 1 %}
                <p class="text-green">-{{ item.optPoints }}</p>
              {% else %}
                <p class="text-orange">+{{ item.optPoints }}</p>
              {% endif %}
              <p>余额：{{ item.surplusPoints|toFixed(2) }}</p>
            </span>
          </div>
        </div>
      {% endfor %}
    </script>
  {% endraw %}
{% endblock %}
{% block script %}
  {% parent %}
  <script src="{{ '/static/js/integral.js'|version }}"></script>
{% endblock %}